Complex numbers
Once again the sympy module will be used. We only need to import part of the module to manipulate complex numbers:
from sympy import Abs, Symbol, S, I
Manipulating complex numbers
Complex numbers can be written like this 2*I+3.
Here is a list of the essential functions:
re(x)returns the real part of a complex number xim(x)returns the imaginary part of a complex number xabs(x)returns the absolute value of the argument of a complex number xarg(x)returns the argument (in radians) of a complex number xconjugate(x)returns the conjugate of a complex number x